home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_STRING_COPY
-
- creation {ANY}
- make
-
- feature {ANY}
-
- make is
- local
- s1, s2: STRING;
- do
- s2 := clone(str);
- s1 := "CDE";
- str.copy(s1);
- is_true(str.count = 3);
- is_true(s1 /= str);
- is_true('C' = s1.item(1));
- is_true('D' = s1.item(2));
- is_true('E' = s1.item(3));
-
- is_true(equal("ABCDE",s2));
- end;
-
- str: STRING is "ABCDE";
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_STRING_COPY: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- -- std_output.put_string("Yes %N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_STRING_COPY
-